//
//  CompletionStatusTableViewCell.m
//  YaDiuDiu
//
//  Created by 陈刚 on 2017/9/29.
//  Copyright © 2017年 jy. All rights reserved.
//

#import "CompletionStatusTableViewCell.h"

@interface CompletionStatusTableViewCell ()

@property (nonatomic, strong) UILabel *itemLabel;

@property (nonatomic, strong) UIView *lineView;

@end

@implementation CompletionStatusTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupView];
        
        [self addConstraint];
    }
    return self;
}

- (void)setupView{
    self.itemLabel = [[UILabel alloc]init];
    [self.itemLabel setFont:[UIFont systemFontOfSize:14]];
    [self.itemLabel setTextColor:HexColorInt32_t(333333)];
    [self addSubview:self.itemLabel];
    
    self.lineView = [[UIView alloc]init];
    [self.lineView setBackgroundColor:HexColorInt32_t(e6e6e6)];
    [self addSubview:self.lineView];
}

- (void)addConstraint{
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(1);
        make.left.equalTo(0);
        make.bottom.equalTo(0);
        make.right.equalTo(0);
    }];
    
    [self.itemLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(13);
        make.top.equalTo(0);
        make.bottom.equalTo(0);
        make.right.equalTo(0);
    }];
}

- (void)setcompleData:(AllClassIfyModel *)model{
    [self.itemLabel setText:model.title];
    if (model.isSel == YES) {
        [self.itemLabel setTextColor:HexColorInt32_t(FD1142)];
    }else{
        [self.itemLabel setTextColor:HexColorInt32_t(333333)];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
